<template>
  <div>
  	<mt-swipe :auto="4000" class='adlist' v-if='adlist.length > 0'>
		  <mt-swipe-item v-for='(item,index) in adlist' :key='index' class='aditem'>
		  	<img v-lazy.container="item.ImageUrl" @click='skip(item.Content)' class="bgimg">
		  </mt-swipe-item>
		</mt-swipe>
    <div class="list" v-for='(item,index) in list' @click='navclick(item.VisitResult,item.QsID)'>
    	<div class="imgbox">
    		<img  v-lazy.container="item.AppCover" class="bgimg">
    	</div>
    	<div class="contbox">
    		<div class="title">{{item.Name}}</div>
    		<div class="conttext">{{item.Description}}</div>
    	</div>
    </div>
  </div>
</template>

<script>
import Vue from 'vue'
import { Lazyload ,Swipe, SwipeItem, MessageBox } from 'mint-ui'
Vue.use(Lazyload)
Vue.component(Swipe.name, Swipe);
Vue.component(SwipeItem.name, SwipeItem)
export default {
  name: 'indexlist',
  data(){
  	return {

  	}
  },
  props: {list:{type:Array},adlist:{type:Array}},
  methods: {
    skip: function(context){
    	if(context.indexOf('www.nahuo.com') == -1){

    	}else{
    		window.location.href = context;
    	}
    },
    navclick:function(obj,qsid){
      if(obj.CanVisit){
        this.$router.push({path:'/detail',query:{qsid:qsid}})
      }else{
        MessageBox({
          title: '提示',
          message: obj.Message,
          showCancelButton: false,
          closeOnClickModal: false
        });
      }
    }
  },
  mounted:function() {

  },
  components:{
  	
  }
}
</script>
<style scoped>
	.list{width: 100%;overflow: hidden;border-radius: 2px;background-color: #fff;box-shadow: rgba(0,0,0,.239216) 0px 2px 5px 0px;margin-bottom: 20px;margin-top: 10px;}
	.imgbox{width: 100%;height: 210px;overflow: hidden;height: 210px;}
	.imgbox img{ width: 100%;display: inline-block;vertical-align: middle;height: 100%;object-fit:cover;}
	.contbox{justify-content: space-between;padding: 10px;}
	.title{font-size: 14px;color: #555;padding-top: 10px;width: 100%}
	.conttext{font-size: 12px;color: #a1a1a1;padding-top: 10px;}
	.adlist,.aditem{width: 100%;min-height: 117px;height: 117px;}
	.aditem img{width: 100%;display: block;}
</style>